import React from "react";
import { Button } from "antd";
import { RedoOutlined } from "@ant-design/icons";
import "./index.scss";
const TitleHandlerDiv = ({
  isShowBtn = true,
  showHandlerArea = false,
  handlerBtnClick,
  btnText = "+新建",
  className = "title-handler-box",
  style = {},
  ...props
}) => {
  return (
    <div className={className} style={style}>
      {showHandlerArea ? <>{props.children}</> : <div></div>}
      <div className="handler-btn-box">
        {isShowBtn ? (
          <Button type="primary" onClick={handlerBtnClick}>
            {btnText}
          </Button>
        ) : (
          <></>
        )}

        <RedoOutlined />
      </div>
    </div>
  );
};
export default TitleHandlerDiv;
